// custom-tab-bar/index.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    selected:0,
    "color": "#ccc",
    "selectedColor": "#000",
    list: [
      {
        "pagePath": "/pages/home/home",
        "iconPath": "/img/首页黑.png",
        "selectedIconPath": "/img/首页粉.png",
        "text": "首页"
      },
      {
        "pagePath": "/pages/hand/hand",
        "iconPath": "/img/闲置黑.png",
        "selectedIconPath": "/img/闲置橙.png",
        "text": "闲置"
      },
      {
        "pagePath": "/pages/fabu/fabu",
        "iconPath": "/img/加号黑.png",
        "selectedIconPath": "/img/加号绿.png",
        "text":""   
      },
      {
        "pagePath": "/pages/message/message",
        "iconPath": "/img/消息黑.png",
        "selectedIconPath": "/img/消息蓝.png",
        "text": "消息"
      },
      {
        "pagePath": "/pages/my/my",
        "iconPath": "/img/我的黑.png",
        "selectedIconPath": "/img/我的黄.png",
        "text": "我的"
      }
    ],
  },
  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e){
      const{index,url}=e.currentTarget.dataset;
      if(this.data.selected==index || index==undefined)return;
      wx.switchTab({
        url,
      })
    }
  }
})